# -*- encoding: utf-8 -*-
"""
@File    : pathutils.py
@Time    : 2020/11/30 15:30
@Author  : wp
@Email   : wangpeng99@picc.com.cn
@Software: PyCharm
"""
import os
#获取项目绝对路径
def getRootPath():
    rootPath = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.path.pardir))
    return rootPath
#根据传入的多个目录名，构建绝对路径
def buildAbsPath(*args):
    rootPath = getRootPath()
    return os.path.join(rootPath,*args)

#根据传入的多个目录名，构建相对路径
def buildRelPath(*args):
    return os.path.join(*args)

if __name__ == '__main__':
    print(getRootPath())
    print(buildAbsPath("resources","aa"))
    print(buildRelPath("resources","aa"))